<template>
  <div class="chat-list">
    <div class="search-div">
      <div class="input-div">
        <Icon type="ios-search" />
        <input placeholder="搜索" />
      </div>
      <div class="btn-add">
        <Icon type="md-add" />
      </div>
    </div>
    <div class="list-div">
      <vue-scroll>
        <div class="list-cell" v-for="item in chatList" :key="item.id">
          <div class="avatar">
            <img src="../../assets/img/icon.svg" />
          </div>
          <div class="title text-elip">{{ item.name }}</div>
          <div class="msg text-elip">{{ item.msg }}</div>
          <div class="date">{{ item.date }}</div>
          <div class="mute" v-if="item.isMute">
            <Icon type="md-notifications-off" />
          </div>
        </div>
      </vue-scroll>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      chatList: [
        {
          name: '美女',
          msg: '这里是消息这里是消息这里是消息',
          date: '22:25',
          isMute: false
        },
        {
          name: '少年',
          msg: '123',
          date: '昨天',
          isMute: true
        },
        {
          name: '老人',
          msg: '这里是消息这里是消息这里是消息',
          date: '7/28',
          isMute: false
        },
        {
          name: '孩子们',
          msg: '这里是消息',
          date: '7/28',
          isMute: false
        },
        {
          name: '美女',
          msg: '这里是消息这里是消息',
          date: '22:25',
          isMute: true
        },
        {
          name: '美女',
          msg: 'dfg',
          date: '19/4/22',
          isMute: false
        },
        {
          name: '美女',
          msg: 'dfg',
          date: '19/4/22',
          isMute: false
        },
        {
          name: '美女',
          msg: 'dfg',
          date: '19/4/22',
          isMute: false
        },
        {
          name: '美女',
          msg: 'dfg',
          date: '19/4/22',
          isMute: false
        },
        {
          name: '美女',
          msg: 'dfg',
          date: '19/4/22',
          isMute: false
        },
        {
          name: '美女',
          msg: 'dfg',
          date: '19/4/22',
          isMute: false
        },
        {
          name: '美女',
          msg: 'dfg',
          date: '19/4/22',
          isMute: false
        },
        {
          name: '美女',
          msg: 'dfg',
          date: '19/4/22',
          isMute: false
        },
        {
          name: '美女',
          msg: 'dfg',
          date: '19/4/22',
          isMute: false
        },
        {
          name: '美女',
          msg: 'dfg',
          date: '19/4/22',
          isMute: false
        },
        {
          name: '美女',
          msg: 'dfg',
          date: '19/4/22',
          isMute: false
        }
      ]
    }
  },
  mounted() {},
  beforeDestroy() {},
  methods: {}
}
</script>

<style scoped>
.chat-list {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 250px;
  background-color: #e4e7ed;
}

.search-div {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
}

.search-div .input-div {
  position: absolute;
  top: 0;
  left: 13px;
  right: 50px;
  height: 23px;
}

.search-div .input-div i {
  position: absolute;
  font-size: 14px;
  top: 5px;
  left: 5px;
}

.search-div .input-div input {
  height: 23px;
  line-height: 23px;
  padding-left: 23px;
  font-size: 12px;
  border: 0;
  border-radius: 4px;
  padding-top: 0;
  padding-bottom: 0;
  background-color: #dcdfe6;
}

.search-div .input-div input:focus {
  background-color: #f2f6fc;
}

.search-div .btn-add {
  position: absolute;
  top: 0;
  right: 13px;
  width: 28px;
  height: 23px;
  line-height: 23px;
  text-align: center;
  font-size: 14px;
  background-color: #dcdfe6;
  border-radius: 4px;
  cursor: pointer;
}

.search-div .btn-add:hover {
  background-color: #e4e7ed;
}

.list-div {
  position: absolute;
  box-sizing: border-box;
  top: 36px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #dcdfe6;
}

.list-cell {
  position: relative;
  height: 66px;
  -webkit-user-select: none;
}

.list-cell:hover {
  background-color: #cfe5e7;
}

.list-cell .avatar {
  position: absolute;
  top: 13px;
  left: 13px;
  height: 40px;
  width: 40px;
}

.list-cell .avatar img {
  height: 100%;
  width: 100%;
}

.list-cell .title {
  position: absolute;
  top: 13px;
  left: 63px;
  height: 20px;
  line-height: 20px;
  right: 55px;
  font-size: 16px;
}

.list-cell .msg {
  position: absolute;
  top: 33px;
  left: 63px;
  height: 20px;
  line-height: 20px;
  right: 55px;
  font-size: 12px;
  color: #999;
}

.list-cell .date {
  position: absolute;
  top: 13px;
  right: 13px;
  height: 20px;
  line-height: 20px;
  width: 42px;
  font-size: 10px;
  color: #999;
  text-align: right;
}

.list-cell .mute {
  position: absolute;
  top: 33px;
  right: 13px;
  height: 20px;
  line-height: 20px;
  width: 42px;
  font-size: 14px;
  color: #999;
  text-align: right;
}

.chat-this {
  position: absolute;
  top: 60px;
  left: 0;
  width: 250px;
  height: 60px;
  background-color: #c6e6e8;
}
</style>
